package com.dianmi.seckill.controller;

import com.dianmi.seckill.service.ProductService;
import com.dianmi.seckill.vo.SeckillProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xieqiaofu
 * @date 2021/4/2
 */
@RequestMapping("/product")
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @PostMapping(value = "/upToShelves", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public Boolean upToShelves(@RequestBody SeckillProductInfo productInfo) {
        return productService.upToShelves(productInfo);
    }
}
